package com.motong.gongdan.service;

import cn.hutool.http.HttpRequest;
import cn.hutool.json.JSONUtil;
import com.motong.gongdan.vo.system.Erp.vo.PushOrderNumVo;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

/**
 * erp服务相关接口
 */
@Service
public class ErpServiceImpl {


    @Value("${Erp.serviceUrl}")
    private String ErpServiceUrl;

    // 推送订单完成状况
    public void pushOrderNum(PushOrderNumVo pushOrderParam) {
        String ERP_OTHER_WAREHOUSING = ErpServiceUrl.concat("/gongDan/finishSaleOrder");
        String stringRes = HttpRequest.post(ERP_OTHER_WAREHOUSING).contentType(MediaType.APPLICATION_JSON_VALUE)
                .body(JSONUtil.toJsonStr(pushOrderParam)).execute().body();
        if (StringUtils.hasLength(stringRes)){

        }
    }
}
